package com.cashbox.gui.componentes;

import java.awt.AlphaComposite;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Shape;
import java.awt.geom.RoundRectangle2D;

/**
 *
 * @author Gustavo Enrique Ruiz Cisneros
 */
public class CashBoxPanel extends javax.swing.JPanel {

    private float anchoDeBorde = 0;

    public CashBoxPanel() {
        //setLayout(new BorderLayout());
        setOpaque(false);
        setBackground(new Color(50, 50, 50));
    }

    @Override
    protected void paintComponent(Graphics g) {
        Graphics2D graphics2d = (Graphics2D) g.create();
        graphics2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

        graphics2d.setComposite(AlphaComposite.Src);

        graphics2d.setColor(getBackground());
        graphics2d.fillRoundRect(0, 0, getWidth(), getHeight(),8, 8);

        graphics2d.dispose();
    }
    
        @Override
    public void setSize(Dimension dmnsn) {
        Dimension frameSize = new Dimension(super.getWidth(), super.getHeight());
        super.setSize(frameSize);
    }

    public Shape getShape() {
        return new RoundRectangle2D.Float(0, 0, getWidth(), getHeight(), 8, 8);
    }

    public float getAnchoDeBorde() {
        return anchoDeBorde;
    }

    public void setAnchoDeBorde(float anchoDeBorde) {
        this.anchoDeBorde = anchoDeBorde;
    }
}
